<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%@ taglib uri="http://www.springframework.org/security/tags"
	prefix="sec"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
    <!--[if IE 9 ]><html class="ie9"><![endif]-->
    <head>
        <meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<title>Telomere</title>
		<link rel="shortcut icon" href="img/logo.png">

        <!-- Vendor CSS -->
        <link href="vendors/bower_components/animate.css/animate.min.css" rel="stylesheet">
        <link href="vendors/bower_components/material-design-iconic-font/dist/css/material-design-iconic-font.min.css" rel="stylesheet">

        <!-- CSS -->
        <link href="css/app_1.min.css" rel="stylesheet">
        <link href="css/app_2.min.css" rel="stylesheet">
    </head>

    <body>
        <div class="login-content">
            <!-- Login -->
            <div class="lc-block toggled" id="l-login">
            	<form id="loginform" action="<%=path%>/j_spring_security_check" method="post">
                <div class="lcb-form">
                	<h2>Telomere</h2>
                	<div>
                    	<p style="color:#f00;">${sessionScope.SPRING_SECURITY_LAST_EXCEPTION.message}</p>
                    </div>
                    <div class="input-group m-b-20">
                        <span class="input-group-addon"><i class="zmdi zmdi-account"></i></span>
                        <div class="fg-line">
                            <input type="text" id="input-username" class="form-control" name='j_username' placeholder="账号">
                        </div>
                    </div>

                    <div class="input-group m-b-20">
                        <span class="input-group-addon"><i class="zmdi zmdi-male"></i></span>
                        <div class="fg-line">
                            <input type="password" class="form-control" name='j_password' placeholder="密码">
                        </div>
                    </div>

                    <div class="checkbox">
                        <label>
                            <input type="checkbox" name="_spring_security_remember_me" value="true">
                            <i class="input-helper"></i>
                            	两周内免登陆
                        </label>
                    </div>

                    <a href="javascript:login()" class="btn btn-login btn-success btn-float"><i class="zmdi zmdi-arrow-forward"></i></a>
                </div>
                </form>
                <h5 style="color:#fff;">Copyright &copy; 2017 Clinbytes</h5>
            </div>
            
        <!-- Older IE warning message -->
		<!--[if lt IE 9]>
		<div class="ie-warning">
			<h1 class="c-white">警告!!</h1>
			<p>
				您正在使用低版本的IE浏览器, 请升级至
				<br />以下的浏览器来正常访问.
			</p>
			<div class="iew-container">
				<ul class="iew-download">
					<li><a> <img
							src="img/browsers/chrome.png" alt="">
							<div>Chrome</div>
					</a></li>
					<li><a> <img
							src="img/browsers/firefox.png" alt="">
							<div>Firefox</div>
					</a></li>
					<li><a> <img
							src="img/browsers/opera.png" alt="">
							<div>Opera</div>
					</a></li>
					<li><a> <img
							src="img/browsers/safari.png" alt="">
							<div>Safari</div>
					</a></li>
					<li><a>
							<img src="img/browsers/ie.png" alt="">
							<div>IE (New)</div>
					</a></li>
				</ul>
			</div>
			<p>抱歉为您带来不便!</p>
		</div>
		<![endif]-->    

        <!-- Javascript Libraries -->
        <script src="vendors/bower_components/jquery/dist/jquery.min.js"></script>
        <script src="vendors/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>

        <script src="vendors/bower_components/Waves/dist/waves.min.js"></script>

        <!-- Placeholder for IE9 -->
        <!--[if IE 9 ]>
            <script src="vendors/bower_components/jquery-placeholder/jquery.placeholder.min.js"></script>
        <![endif]-->

        <script src="js/app.min.js"></script>
        <script type="text/javascript">
        	if (document.addEventListener) {
    			document.addEventListener("keypress", fireFoxHandler, true);
    		} else {
    			document.attachEvent("onkeypress", ieHandler);
    		}
			
    		function fireFoxHandler(evt) {
    			if (evt.keyCode == 13) {
    				$('#loginform').submit();
    			}
    		}

    		function ieHandler(evt) {
    			if (evt.keyCode == 13) {
    				$('#loginform').submit();
    			}
    		}
        	function login(){
        		$('#loginform').submit();
        	};
        	jQuery(document).ready(function() {       
                $('#input-username').focus();
             });
        </script>
    </body>
</html>
